package com.utils.singleton;


import java.util.HashMap;

/**
 * @ClassName SingletonDemo
 * @Description TODO
 * @Author 谭庆伟
 * @Date 2020/11/27 10:51
 * @Version 1.0
 **/
public enum  SingletonDemo {
    INSTANCE("abc");
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private SingletonDemo(String name){
        this.name = name;
    }

    public static void main(String[] args) {

        HashMap<String, Object> hashMap = new HashMap<>();

        for (int i = 0; i < 100; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println(SingletonDemo.INSTANCE.hashCode());
                }
            }).start();
        }
    }
}
